<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<title>二号仓库存记录｜海外仓管理</title>
<script type="text/javascript">
function addstock()
{
	$('#changstatusform').modal('show');
}
function changstock()
{
	$('#changstockform').modal('show');
}

function stockout()
{
	var vote_arr = document.getElementsByName("ppid[]");
	var idarr = new Array();
	var i=0;
	var str="";
	for(var j = 0; j < vote_arr.length; j++)
	{
	   if(vote_arr[j].checked == true)
	   {
	       idarr[i] = vote_arr[j].value;
		   str += vote_arr[j].value+",";
		   i++;
	   }
	   
	}
	if(i<=0){
		alert("未选中数据");
	}else{
		$.post("/oversea/ajaxbutton", {"op": "stockout","str":str},
		  function(data){
			
				if(data)
				{
					var tmp = "";
					for(var i=0;i<data.length;i++)
					{
						tmp+="  <tr>";
						tmp+=" <td class=\"head0\" width=15%>"+data[i].sku+"</td>";
						tmp+=" <td class=\"head1\" width=35%>"+data[i].goodsname+"</td>";
						tmp+=" <td class=\"head0\" width=25%>"+data[i].stock+"</td>";
						tmp+=' <td class=\"head1\" width=25%><input type="text" name="nums[]" id="nums" class="width50" value="{{$li.check_id}}" placeholder="填写数字")"  /><input type="hidden" name="id[]"  class="width50" value='+data[i].id+' /><input type="hidden" name="sku[]"  class="width50" value="'+data[i].sku+'" /></td>';
						
					}
					
					$("#showlist").html(tmp);
				}
			
		   },"json");	
	}
	
	$('#stockoutform').modal('show');
}
</script>
<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/leftmenu.tpl'}}
<div class="centercontent tables">
  <div class="pageheader notab">
    <h1 class="pagetitle">二号仓库存记录</h1>
    <span class="pagedesc"></span>
     <div class="menulist">
        		<ul class="profile_summary">
                       {{if $managers || in_array('88',$showpower)}} <li><a href="javascript:void(0)" onClick="addstock()"><span>入库操作</span></a></li>{{/if}}
                       {{if $managers || in_array('91',$showpower)}}<li><a href="javascript:void(0)" onClick="changstock()"><span>盘点操作</span></a></li>{{/if}}
                        
                    </ul>
               </div>
    
     </div>
  <!--pageheader-->
  
  <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
  <div id="contentwrapper" class="contentwrapper"> 
    <!--搜索栏-->
    <form class="stdform stdform2" method="get" action="/oversea/stocklist">
      <div class="tableoptions"> 
       
       商品编号: <input type="text" name="other" id="other" class="width100" value="{{$other}}" />
       
        <button class="btn btn_orange btn_search radius50">Search</button>
       &nbsp;&nbsp;&nbsp;&nbsp;  <a href="javascript:void(0)" onClick="stockout(1)" class="btn btn2 btn_help"><span>出库</span></a>
      </div>
    </form>
    <!--搜索栏结束-->
     <div class="x_content" style="overflow-x:auto;">
    <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
      <colgroup>
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      </colgroup>
      <thead>
        <tr>
          <th class="head0"><input name="allchk" id="allchk" type="checkbox" onClick="allSelect('ppid[]')"></th>
          <th class="head0">商品编号</th>
          <th class="head1">商品名称</th>
          <th class="head0">重量 KG</th>
          <th class="head1">体积 CBM</th>
          <th class="head0">成本价</th>
          <th class="head0">库存数</th>
        </tr>
      </thead>
      <tbody>
      
      {{foreach from=$list item=li key=key}}
      <tr  {{if $li.goods.st==1}}bgcolor="#FFD2D2" title="带商标商品"{{/if}} {{if $li.goods.hw==1}}bgcolor="#CCFFFF" title="只允许发海外仓商品"{{/if}}>
       <td><input name="ppid[]" type="checkbox" value="{{$li.id}}"></td>
        <td>{{$li.sku}}</td>
        <td>{{$li.goods.name}}</td>
        <td>{{$li.goods.weight}}</td>
        <td class="center">{{$li.goods.volumenum}}</td>
        <td class="center">{{$li.goods.costprice}}</td>
        <td class="center">{{$li.stock}}</td>
       
      </tr>
      {{/foreach}}
        </tbody>
      
    </table>
    </div>
    <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
    <br />
    <br />
  </div>
</div>
<!--bodywrapper-->
<!-- 模态框（Modal） SKU状态 -->
<form action="/oversea/ajaxbutton?op=addstock"  method="post" name="otherforms" id="otherforms" >
  <div class="modal fade" id="changstatusform" tabindex="-1" role="dialog" aria-labelledby="schangstatusform" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="schangstatusform">入库操作 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>SKU(一行一个):<textarea name="sku" id="sku" cols="50" rows="5" class="longinput"></textarea>
                </td>
            </tr>
        
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="submit" class="btn btn-primary" > 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）状态结束 -->


<!-- 模态框（Modal）出库操作 -->
<form action="/oversea/ajaxbutton?op=changstockform"  method="post" name="otherforms" id="otherforms" >
  <div class="modal fade" id="changstockform" tabindex="-1" role="dialog" aria-labelledby="schangstockform" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="schangstockform">盘点 </h4>
        </div>
        <div class="modal-body">
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>SKU(格式一行一个： SKU，数量；如 130149-XL,1):<textarea name="sku" id="sku" cols="50" rows="5" class="longinput"></textarea>
                </td>
            </tr>
        
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="submit" class="btn btn-primary" > 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）状态结束 -->

<!-- 模态框（Modal） 盘点操作 -->
<form action="/oversea/ajaxbutton?op=savestockout"  method="post" name="otherforms" id="otherforms" >
  <div class="modal fade" id="stockoutform" tabindex="-1" role="dialog" aria-labelledby="sstockoutform" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sstockoutform">出库操作 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
           <tr>
          <th class="head0">SKU</th>
          <th class="head1">商品名称</th>
          <th class="head0">库存数</th>
          <th class="head0">需要出库数</th>
        </tr>
        <tbody>
        <tr><td colspan="4">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <div style="width:100%;height:400px; overflow-y:scroll; border:0px solid;">
         <span id="showlist"></span>
         </div>
        </table>
        </td></tr>
        
        </tbody>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="submit" class="btn btn-primary" > 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）状态结束 -->
</body>
</html>